package com.example.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * TODO
 *
 * @Author gaokaikai
 * @CreateDate 2023/3/14 17:27
 * @Version 1.0
 */
public class WebVisitFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        /**
         * 这里做业务处理:
         * 1.登录验证
         * 2.统一编码处理
         * 3.敏感字符过滤
         */

        System.out.println("进入目标资源之前");
        chain.doFilter(request,response);
        System.out.println("处理下一个response");
    }

    @Override
    public void destroy() {

    }
}
